filechoosernative: forward current_filter to delegate dialog
authorMichael Catanzaro <mcatanzaro@igalia.com>
Thu, 29 Nov 2018 21:34:17 +0000 (15:34 -0600)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 19 Jan 2019 01:01:37 +0000 (20:01 -0500)
gtk_file_chooser_set_filter() doesn't work for GtkFileChooserNative. The
code forwards added and removed filters to the delegate dialog, but
doesn't do anything to set the selected one, so the wrong one gets
chosen. So fix that.

This only fixes the fallback dialog. The portal will be fixed in a
subsequent commit.

Partial fix for #1492

gtk/gtkfilechoosernative.c

index 0d4d6a291120060cc23434fc54bf679f7d1f1aa7..b6c65b449b481329c8a76a0154c2279d8a7725d2 100644 (file)
@@ -458,6 +458,7 @@ gtk_file_chooser_native_set_property (GObject      *object,
 
     case GTK_FILE_CHOOSER_PROP_FILTER:
       self->current_filter = g_value_get_object (value);
+      gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (self->dialog), self->current_filter);
       g_object_notify (G_OBJECT (self), "filter");
       break;